package com.ruoyi.system.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StoredValueCardRuleOperationLogMapper;
import com.ruoyi.system.domain.StoredValueCardRuleOperationLog;
import com.ruoyi.system.service.IStoredValueCardRuleOperationLogService;

/**
 * 储值卡规则操作记录 Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-22
 */
@Service
public class StoredValueCardRuleOperationLogServiceImpl implements IStoredValueCardRuleOperationLogService
{
    @Autowired
    private StoredValueCardRuleOperationLogMapper storedValueCardRuleOperationLogMapper;

    /**
     * 通过id查询储值卡规则操作记录
     *
     * @param id 储值卡规则操作记录主键
     * @return 储值卡规则操作记录
     */
    @Override
    public StoredValueCardRuleOperationLog selectStoredValueCardRuleOperationLogById(Long id)
    {
        return storedValueCardRuleOperationLogMapper.selectStoredValueCardRuleOperationLogById(id);
    }

    /**
     * 通过操作门店，操作类型，储值卡编码，操作开始时间和操作结束时间查询储值卡规则操作记录列表
     *
     * @param operatorStore,operationType,cardCode,operationStartTime,operationEndTime 操作门店，操作类型，储值卡编码，操作开始时间，操作结束时间
     * @return 储值卡规则操作记录，记录储值卡规则变更的全生命周期操作详情
     */
    @Override
    public List<StoredValueCardRuleOperationLog> selectStoredValueCardRuleOperationLogListByConditions(String operatorStore, String operationType, String cardCode, Date operationStartTime, Date operationEndTime)
    {
        return storedValueCardRuleOperationLogMapper.selectStoredValueCardRuleOperationLogListByConditions(operatorStore,operationType,cardCode,operationStartTime,operationEndTime);
    }

    /**
     * 新增储值卡规则操作记录
     *
     * @param storedValueCardRuleOperationLog 储值卡规则操作记录
     * @return 结果
     */
    @Override
    public int insertStoredValueCardRuleOperationLog(StoredValueCardRuleOperationLog storedValueCardRuleOperationLog)
    {
        storedValueCardRuleOperationLog.setCreateTime(DateUtils.getNowDate());
        return storedValueCardRuleOperationLogMapper.insertStoredValueCardRuleOperationLog(storedValueCardRuleOperationLog);
    }

    /**
     * 修改储值卡规则操作记录
     *
     * @param storedValueCardRuleOperationLog 储值卡规则操作记录
     * @return 结果
     */
    @Override
    public int updateStoredValueCardRuleOperationLog(StoredValueCardRuleOperationLog storedValueCardRuleOperationLog)
    {
        return storedValueCardRuleOperationLogMapper.updateStoredValueCardRuleOperationLog(storedValueCardRuleOperationLog);
    }

    /**
     * 通过id批量删除储值卡规则操作记录信息
     *
     * @param ids 需要删除的储值卡规则操作记录主键
     * @return 结果
     */
    @Override
    public int deleteStoredValueCardRuleOperationLogByIds(Long[] ids)
    {
        return storedValueCardRuleOperationLogMapper.deleteStoredValueCardRuleOperationLogByIds(ids);
    }

    /**
     * 通过id删除储值卡规则操作记录信息
     *
     * @param id 储值卡规则操作记录主键
     * @return 结果
     */
    @Override
    public int deleteStoredValueCardRuleOperationLogById(Long id)
    {
        return storedValueCardRuleOperationLogMapper.deleteStoredValueCardRuleOperationLogById(id);
    }
}
